<!DOCTYPE html>
<html class="x-admin-sm" xmlns="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>消息中心</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<link data-th-include="commons/frame :: resource" />
	</head>
	<body>
		<div class="x-body">
			<blockquote class="layui-elem-quote">
			<!-- 	<span data-th-text="|欢迎：${user.nikename}|"></span> -->
				<span class="x-red" data-th-text="${session.Account.account}">test</span>！当前时间:<span id="time"></span>
			</blockquote>
			<fieldset class="layui-elem-field">
				<legend>消息统计</legend>
				<div class="layui-field-box">
					<div class="layui-col-md12">
						<div class="layui-card">
							<div class="layui-card-body">
								<div class="layui-carousel x-admin-carousel x-admin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none"
								 style="width: 100%; height: 90px;">
									<div carousel-item="">
										<ul class="layui-row layui-col-space10 layui-this">
											<li class="layui-col-xs2">
												<a href="javascript:;" class="x-admin-backlog-body">
													<h3>公司公告数</h3>
													<p class="p-margin-top">
														<cite id="AllAnnNum" class="num"></cite></p>
												</a>
											</li>
											<li class="layui-col-xs2">
												<a href="javascript:;" class="x-admin-backlog-body">
													<h3>部门公告数</h3>
													<p class="p-margin-top">
														<cite id="DeAnnNum" class="num"></cite></p>
												</a>
											</li>
											<li class="layui-col-xs2">
												<a href="javascript:;" class="x-admin-backlog-body">
													<h3>所在部门</h3>
													<p class="p-margin-top">
														<cite id="DepartmentName" class="num"></cite></p>
												</a>
											</li>
											<li class="layui-col-xs2">
												<a href="javascript:;" class="x-admin-backlog-body">
													<h3>部门人数</h3>
													<p class="p-margin-top">
														<cite id="DepartmentNum" class="num"></cite></p>
												</a>
											</li>
											<li class="layui-col-xs2">
												<a href="javascript:;" class="x-admin-backlog-body">
													<h3>未读消息数</h3>
													<p class="p-margin-top">
														<cite id="UnReadMsgNum" class="num"></cite></p>
												</a>
											</li>
											<li class="layui-col-xs2">
												<a href="javascript:;" class="x-admin-backlog-body">
													<h3>消息总数</h3>
													<p class="p-margin-top">
														<cite id="AllMsgNum" class="num"></cite></p>
												</a>
											</li>
										</ul>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</fieldset>
		</div>
	</body>
</html>
<script>
	document.getElementById("time").innerHTML = new Date().toLocaleString();
</script>
<script>
	window.onload=function(){
		$.ajax({
			type : "get",    //请求类型
			url : "/count",//请求的 URL地址
			success :function(data){
				document.getElementById("DeAnnNum").innerHTML=data.DeAnnNum;
				document.getElementById("UnReadMsgNum").innerHTML=data.UnReadMsgNum;
				document.getElementById("DepartmentNum").innerHTML=data.DepartmentNum;
				document.getElementById("DepartmentName").innerHTML=data.DepartmentName;
				document.getElementById("AllAnnNum").innerHTML=data.AllAnnNum;
				document.getElementById("AllMsgNum").innerHTML=data.AllMsgNum;
			}
		});
	}
</script>